package com.itheima.mapper;

import com.itheima.pojo.CheckGroup;
import com.itheima.pojo.CheckItem;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface CheckGroupMapper {
    @Insert("INSERT INTO t_checkgroup (code, name, helpCode, sex, remark, attention) " +
            "VALUES (#{code}, #{name}, #{helpCode}, #{sex}, #{remark}, #{attention})")
    int insert(CheckGroup checkGroup);
    @Delete("DELETE FROM t_checkgroup WHERE id = #{id}")
    int delete(Integer id);

    int update(CheckGroup checkGroup);

    List<CheckGroup> findByCode(String code, int offset, int pageSize);

    int countByCode(String code);

    List<CheckGroup> findByName(String name, int offset, int pageSize);

    int countByName(String name);

    CheckGroup findById(Integer id);

    List<CheckGroup> findPage(int offset, int pageSize);

    long count();


    List<String> findAll();
}
